#ifndef ENV_PRO_DEV_H__
#define ENV_PRO_DEV_H__

#include <pthread.h>
#include <curl/curl.h>
#include "list.h"
#include "yapiparser.h"
#include "csvparser.h"
#include "types.h"
#include "enprodev.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _tag_envpro_node_t
{
    struct list_head list;
    char* avg;
    int len;
    //char* mean;
} EnvProNode;

typedef void* EnvProPrivMsg;
typedef struct _tag_envpro_dev_t
{
    EnvProPrivMsg msg;
    int (*init)(struct _tag_envpro_dev_t* dev, YapiSerConfig* yapiserconf, YapiParser* parser);
    int (*request)(struct _tag_envpro_dev_t* dev, CsvParser* parser);
    void (*condition)(struct _tag_envpro_dev_t* dev);
    void (*print)(struct _tag_envpro_dev_t* dev);
    void (*begin)(struct _tag_envpro_dev_t* dev);
    int (*is_end)(struct _tag_envpro_dev_t* dev);
    void (*next)(struct _tag_envpro_dev_t* dev);
    char* (*avg_stime)(struct _tag_envpro_dev_t* dev);
    EnvProNode* (*current)(struct _tag_envpro_dev_t* dev);
    void (*destroy_list)(struct _tag_envpro_dev_t* dev);
} EnvProDev;

EnvProDev* envprodev_create(void);
EnvProDev* envprodev_destroy(EnvProDev* dev);

void envprodev_simu_request(EnvProDev* dev);


#ifdef __cplusplus
}
#endif


#endif